package com.ynny.demo08;
       import java.time.LocalDateTime;
import java.util.Scanner;
public class Test1 {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            while (true) {
                System.out.print("输入任何字符继续循环，输入'n'退出：");
                String sc = scanner.nextLine();
                if (sc.equals("n")) {
                    break;
                } else {

                    LocalDateTime now = LocalDateTime.now();

                    System.out.println(now);
                }
            }
            scanner.close();
            System.out.println("退出循环。");
        }
    }
